package com.ruoyi.common.core.page;

import io.swagger.annotations.ApiModelProperty;

/**
 * @Description TODO
 * @Version 1.0.0
 * @Date 2024/10/16 15:07
 * @Author wux
 */
public class ResultEntity2<T> {
    @ApiModelProperty("结果（true or false）")
    private Boolean success;
    @ApiModelProperty("编码")
    private int code;
    @ApiModelProperty("描述")
    private String message;
    @ApiModelProperty("返回结果")
    private T data;

    public Boolean getSuccess() {
        return success;
    }

    public void setSuccess(Boolean success) {
        this.success = success;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public static <K> ResultEntity2<K> createSuccess(K object) {
        ResultEntity2<K> responseEntity = new ResultEntity2<>();
        responseEntity.setSuccess(true);
        responseEntity.setCode(200);
        responseEntity.setData(object);
        return responseEntity;
    }

}
